Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunxi 6.12: Switch to v6.12.13, Add HDMI support #7752

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

The-going
Copy link
Contributor

@The-going The-going commented Jan 26, 2025

Description

  • Switch to v6.12.13
  • sun50i-h616 & overlays: sort nodes, add overlays.
  • Add drm sun4i-de33 driver.
  • arm64: dts: Add axp313a.dtsi
  • add sun50i-h616-hdmi-phy support

How Has This Been Tested?

  • Test build kernel
  • Test work HDMI output on boards: BPI-M64, BPI-M4-Berry

@github-actions github-actions bot added size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jan 26, 2025
@pyavitz
Copy link
Collaborator

pyavitz commented Jan 26, 2025

I haven't been able to get the M4 Zero to boot above v2024.04 in Armbian for some reason. I figured it was something in the Kernel patching as I am able to do so in my personal builds.

Does this PR have eMMC boot support?

@The-going
Copy link
Contributor Author

The-going commented Jan 27, 2025

I haven't been able to get the M4 Zero to boot above v2024.04 in Armbian for some reason.

u-boot v2025.01 in the default configuration for h616, implies OF_UPSTREAM to be set to y.
And CONFIG_DEFAULT_DEVICE_TREE="allwinner/sun50i-h618-bananapi-m4-berry".
Therefore, the dts must be placed in the dts/upstream/...... path.

Does this PR have eMMC boot support?

eMMC is detected correctly. I haven't tried downloading from eMMC yet.

Detected problems:
The Ethernet is not working.
The HDMI is not working.

Strange. The same changes on core 6.6, the HDMI works for me,
but the temperature sensor shows a lot and the board turns off.

@The-going
Copy link
Contributor Author

M4 Zero

Is the Ethernet working?

@pyavitz
Copy link
Collaborator

pyavitz commented Jan 27, 2025

M4 Zero

Is the Ethernet working?

It uses emac1, which at this time requires some special driver and although some one recently added it to Armbian I haven't tried testing it. Doesn't even have an eth port anyway, which I'm guessing means there is a HAT you can use on it.

As for the u-boot, yes I've done all that. The issue for me, is that above U-Boot v2024.04 it won't load the Armbian kernel. It just hangs at the loading stage. If I use my own kernel, it loads fine. Not sure why, just like I haven't been able to figure out why the Bluetooth fails to load in Armbian either.

@The-going
Copy link
Contributor Author

As for the u-boot, yes I've done all that. The issue for me, is that above U-Boot v2024.04 it won't load the Armbian kernel

I suspect that this is with the 6.6 kernel.
At the boot stage, as soon as the temperature driver is connected and starts working,
it reads a very large temperature value and shuts down the OS.

@pyavitz
Copy link
Collaborator

pyavitz commented Jan 27, 2025

Maybe some of these patches will help?

@igorpecovnik
Copy link
Member

You decide when this is ready. Also we need to move CURRENT to 6.12, legacy 6.6, edge 6.13 by the end of 2/2025. Any deep problems preventing this?

@The-going
Copy link
Contributor Author

You decide when this is ready. Also we need to move CURRENT to 6.12, legacy 6.6, edge 6.13 by the end of 2/2025. Any deep problems preventing this?

We can reschedule it at any time.
I would like to do this soon.
But I think it's better to fix it first:

  • The 6.6 core works well, except for the temperature sensors for h6-h618, and temperature control is not possible for them.

  • In the 6.12 kernel, for some reason, HDMI does not work for arm64.

  • There are several patches in the 6.12 kernel that add drivers from legacy kernels.
    It seems to me that there are problems there.

  • In the 6.13 kernel, which all the patches have moved to, I have already started making some changes.
    But they need to be tested. Therefore, I am first adding support for a device with an h618 processor.

What should I do first?
Probably something that will turn out faster.
I will inform you additionally when it will be possible to safely combine pull requests.

@igorpecovnik
Copy link
Member

What should I do first?

Kernel 6.12 should be main priority, 6.13 slow.

@The-going
Copy link
Contributor Author

The-going commented Jan 30, 2025

It's been a long time since I've read so much primary documentation.
I saw some inconsistency with the user manual of the h616 processor.
This applies to syscon and ethernet nodes.

@TheSnowfield @chraac @JohnTheCoolingFan
Please tell me, does Ethernet work for your devices on this 6.12 kernel?
No changes to this pull request.

@JohnTheCoolingFan
Copy link
Contributor

Please tell me, does Ethernet work for your devices on this 6.12 kernel?

Tried this branch on bigtreetech cb1, ethernet works as usual.

@Jan-cpu82
Copy link

* In the 6.12 kernel, for some reason, HDMI does not work for arm64.

It looks like after sunxi-6.7 the "drivers-hack-for-h616-hdmi-video-output.patch" and several
drv-media-cedrus-... patches were deleted in commit 5838fac as "unused"
As h616/618 hdmi support is still not in mainline this is stil needed in my opinion.
The easiest solution is probably to take the latest mainlining effort patchset for 6.12:
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/#26045134

@igorpecovnik igorpecovnik added 02 Milestone: First quarter release 05 Milestone: Second quarter release labels Feb 5, 2025
@igorpecovnik
Copy link
Member

The easiest solution

Nothing is easy ;) We are swamped with work and there might be other patches that needs adjustments. Any help is greatly appreciated if we want to squeeze 6.12 to Armbian 25.02 current kernel. No HDMI is deal breaker.

@The-going
Copy link
Contributor Author

The easiest solution is probably to take the latest mainlining effort patchset for 6.12:

26 patches! But this is already an option to use. Thanks for the advice.

@chraac
Copy link
Collaborator

chraac commented Feb 6, 2025

It's been a long time since I've read so much primary documentation. I saw some inconsistency with the user manual of the h616 processor. This applies to syscon and ethernet nodes.

@TheSnowfield @chraac @JohnTheCoolingFan Please tell me, does Ethernet work for your devices on this 6.12 kernel? No changes to this pull request.

The eth work as expected on my opi zero2w
2e18db81f91cac610726c889dd6b9cc0

@The-going
Copy link
Contributor Author

The eth work as expected on my opi zero2w

And I suspect that HDMI is running on your board?

In the settings for your board:
config/boards/orangepizero2w.csc

patch/u-boot/v2024.04/board_orangepizero2w

Bigtreetech-cb1 and bananapi-m4-(zero, berry) use their own separate patch folders.
So, gentlemen, we are doing the same job for the same type of processor (h616-h618).

As far as I understand from the documentation, some hardware parts of the chip are disabled by default.
In order to turn them on, we need to write/change one or more bits in the corresponding registers.
In the image from the manufacturer, this happens at the download stage using the firmware.

It will be very good if we help each other.
Let's put our general changes for u-boot in one folder and make the same settings in our
configuration files for the boards in the build system.
Today I will try to do this for u-boot version v2025.01.
Let's see what happens.

@chraac
Copy link
Collaborator

chraac commented Feb 6, 2025

The eth work as expected on my opi zero2w

And I suspect that HDMI is running on your board?

In the settings for your board: config/boards/orangepizero2w.csc

patch/u-boot/v2024.04/board_orangepizero2w

Bigtreetech-cb1 and bananapi-m4-(zero, berry) use their own separate patch folders. So, gentlemen, we are doing the same job for the same type of processor (h616-h618).

As far as I understand from the documentation, some hardware parts of the chip are disabled by default. In order to turn them on, we need to write/change one or more bits in the corresponding registers. In the image from the manufacturer, this happens at the download stage using the firmware.

It will be very good if we help each other. Let's put our general changes for u-boot in one folder and make the same settings in our configuration files for the boards in the build system. Today I will try to do this for u-boot version v2025.01. Let's see what happens.

The HDMI was not tested yet,
did remember in 6.6, we've some path to enable the hdmi and gpu, not only in dts, but also some changes in driver
for uboot, yeah we can share the same folder since its mosly the same

@The-going
Copy link
Contributor Author

The-going commented Feb 6, 2025

The HDMI was not tested yet,

Without any changes, simply connect the HDMI cable from the monitor to the board and turn it on.

Sorry. I saw you have a patch with a magic register for the GPU.
It doesn't seem to work for me.

@The-going
Copy link
Contributor Author

The-going commented Feb 9, 2025

Added the DE33 driver.
At this stage, the compilation is error-free.
The core runs on the h618 platform.
For proper operation, it seems necessary to add compatibility with

allwinner,sun50i-h616-de33
allwinner,sun50i-h616-de33-clk
allwinner,sun50i-h616-de33-mixer-0

@TheSnowfield
Copy link
Collaborator

It's been a long time since I've read so much primary documentation. I saw some inconsistency with the user manual of the h616 processor. This applies to syscon and ethernet nodes.

@TheSnowfield @chraac @JohnTheCoolingFan Please tell me, does Ethernet work for your devices on this 6.12 kernel? No changes to this pull request.

Sorry, I can't test my sakurapi-3308b, because it was a broken boot on the latest Armbian. I haven't figured out the problem.

@The-going
Copy link
Contributor Author

Sorry, I can't test my sakurapi-3308b

I'm sorry. I thought your interest was sunxi. But your devices are on rockchip chips.

@TheSnowfield
Copy link
Collaborator

Sorry, I can't test my sakurapi-3308b

I'm sorry. I thought your interest was sunxi. But your devices are on rockchip chips.

Haha, never mind. sunxi chip devices will come later :)

@The-going The-going changed the title sunxi 6.12: Switch to v6.12.11, Add BananaPi M4 Berry support sunxi 6.12: Switch to v6.12.13, Add HDMI support Feb 10, 2025
@The-going
Copy link
Contributor Author

DMESG:

bananapim4berry:~$ dmesg | grep -iE 'drm|hdmi|gpu'
[    0.098994] /soc/hdmi@6000000: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.099054] /soc/tcon-top@6510000: Fixed dependency cycle(s) with /soc/hdmi@6000000
[    0.103915] /soc/hdmi@6000000: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.104280] /soc/hdmi@6000000: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.104438] /soc/tcon-top@6510000: Fixed dependency cycle(s) with /soc/hdmi@6000000
[    0.106983] /soc/hdmi@6000000: Fixed dependency cycle(s) with /connector
[    0.107066] /connector: Fixed dependency cycle(s) with /soc/hdmi@6000000
[    1.597542] sun4i-drm display-engine: bound 1100000.mixer (ops 0xffff80008119ac98)
[    1.604970] sun4i-drm display-engine: bound 6510000.tcon-top (ops 0xffff80008119fa38)
[    1.610933] sun4i-drm display-engine: bound 6515000.lcd-controller (ops 0xffff800081197a60)
[    1.613434] sun8i-dw-hdmi 6000000.hdmi: Detected HDMI TX controller v2.12a with HDCP (DWC HDMI 2.0 TX PHY)
[    1.621580] sun8i-dw-hdmi 6000000.hdmi: EVENT=plugin
[    1.622717] sun8i-dw-hdmi 6000000.hdmi: registered DesignWare HDMI I2C bus driver
[    3.483673] sun4i-drm display-engine: bound 6000000.hdmi (ops 0xffff800081199d60)
[    3.491742] [drm] Initialized sun4i-drm 1.0.0 for display-engine on minor 0
[    3.498754] sun8i-dw-hdmi 6000000.hdmi: read_hpd result: 1
[    4.107497] sun4i-drm display-engine: [drm] fb0: sun4i-drmdrmfb frame buffer device
[    8.567030] systemd[1]: Starting [email protected] - Load Kernel Module drm...
[    9.102893] systemd[1]: [email protected]: Deactivated successfully.
[    9.115476] systemd[1]: Finished [email protected] - Load Kernel Module drm.
[   40.468588] sun8i-dw-hdmi 6000000.hdmi: EVENT=plugin
[   41.362152] sun8i-dw-hdmi 6000000.hdmi: EVENT=plugin

At this stage, HDMI works on two boards.
For the h618, the monitor resolution does not switch to the actual available one.
But it's already working.

@igorpecovnik I think it can be taken if someone approves it.

@The-going
Copy link
Contributor Author

Please excuse me.
I will add the bananapi-m4-berry board first to the 6.6 core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release 05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

7 participants